package Bank;
import java.util.Scanner;
public class Bank {
	static String bankName;
	private String name;
	private int password;
	private double balance;
	private double turnover;
	static void welcome() {
		System.out.println("欢迎来到"+Bank.bankName);
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getPassword() {
		return password;
	}
	public void setPassword(int password) {
		this.password = password;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	public double getTurnover() {
		return turnover;
	}
	public void setTurnover(double turnover) {
		this.turnover = turnover;
	}
	public Bank() {
	}
	public Bank(String name,int password,double turnover) {
		this.name=name;
		this.password=password;
		this.turnover=turnover;
		this.balance=turnover-10;
		if(turnover<10) {
			System.out.println("开户费用不足,请核对费用重新开户。");
		}
		else {
		    System.out.println("尊敬的"+this.name+"已成功开户，目前账户余额为"+this.balance);
		}
	}
	public void deposit(double turnover) {
		this.balance=this.balance+turnover;
		System.out.println("尊敬的"+this.name+"您目前账户存入"+turnover+"当前余额"+this.balance+"元");
	}
	public void com(int password1) {
		if(this.password!=password1) {
			System.out.println("密码错误，请重新输入密码：");
			Scanner a= new Scanner(System.in);
			int password11 = a.nextInt();
			com(password11);
		}
		else {
		    System.out.print("密码正确，");
		}
	}
	public void withdrawal(double turnover) {
		if(this.balance<turnover) {
			System.out.println("余额不足");
	    }
		else{
			this.balance=this.balance-turnover;
			System.out.println(this.name+"您好，您已取出"+turnover+"元，当前余额"+this.balance+"元");
		}
	}
	static void elcomeNext() {
		System.out.println("请携带好随身物品，欢迎下次光临"+bankName);
	}
}
